In this assignment, you will:
install the main programs we will use in the course
create your own GitHub account and start a “repository” that is available for everyone to see
learn to “commit” and “push” changes on your local computer to your online GitHub repository
Use the following link to download R for your particular computer system: https://cran.r-project.org/
It’s a good idea to install R before installing R-Studio https://www.rstudio.com/products/rstudio/download/#download
Here’s the download page: https://git-scm.com/downloads
If you are on a Windows computer, click the “Windows” button and your download should start automatically. Run the .exe file to install “Git Bash”
If you are on a Mac, click the “Mac” button and the .dmg file should download automatically. This will open in your software center and install.
If you are on Linux, here are the instructions, depending on your version: https://git-scm.com/download/linux
Once you have Git installed, open it up (in Windows this will be a shortcut called “Git Bash”, in Mac or Linux, just open your terminal -that scary command prompt- and it will be working in the background) You will see a simple command line interface that looks something like this:
Navigate to your computer Desktop using the command-line. If you’ve never done this before, here’s a nice introduction: https://computers.tutsplus.com/tutorials/navigating-the-terminal-a-gentle-introduction--mac-3855
Basically, you can enter commands to move into or out of directories and look at what files are present.
Here’s an example output from those first two commands:
ls #this lists files in my current directory
## Assignment_1.html
## Assignment_1.pdf
## Assignment_1.rmd
pwd #this tells me what my current directory is
## /home/gzahn/Desktop/GIT_REPOSITORIES/gzahn.github.io/data-course/Repository/Assignments/Assignment_1
The “cd” command requires a bit more. You have to tell it what directory to change to…
Mac and Linux users can probably just type “cd ~/Desktop” and they will instantly be on their Desktop folder Windows file paths are a bit different, but it’s probably something like this:
cd C:\Users\YOUR_NAME\Desktop
Once you’re in your Desktop folder (you can check with “pwd”) copy and paste the following into your terminal:
git clone https://github.com/gzahn/test.git
This will download a folder onto your computer. It will be found wherever you were when you entered the previous command….so hopefully your Desktop. This new folder has only one file in it called “README.md”
If you have it, that means you successfully “cloned” my online repository onto your local computer. This “git clone WHATEVER_WEBSITE_ADDRESS” will be very useful to you in this class. It’s how you will access other materials from my GitHub repositories, including exams!
That takes care of the software installation and course materials. Now, you need to set up your own GitHub account online.
I made a short video walkthrough of the following steps here: https://youtu.be/M9430_eGttI
Enable [two-factor authentication]: (https://docs.github.com/en/github/authenticating-to-github/configuring-two-factor-authentication){target="_blank"}
Back in your terminal, navigate to your Desktop with the command-line again
Navigate into this new repository (The one called Data_Course_YOURLASTNAME) and type the following commands in order:
(actually, copy-paste is better than typing. Coders use CTRL-C / CTRL-V more than anything else!)
(What?! It’s not pasting text into your terminal? Ah, use CTRL-SHIFT-V or SHIFT-INS to paste into your terminal!)
echo "This README file contains information about my uploaded assignments" >> README.md
git add README.md
git commit -m "1st commit"
git push
(Here it will ask for your GitHub userID and password....enter those when asked)
This series of commands commits your changes (Adding that text to the README.md file)
and pushes the changes back onto the website version
Check back on your GitHub page online…if you see that new text (“This README file contains information about my uploaded assignments”) then you are finished!
To get credit, upload a link to your GitHub repository to “Assignment 1” in Canvas. I’ll click on that and see whether your README.md file is correct.
You now have a copy of all the current course materials along with your own personal repository This GitHub repository is where you will keep projects you’re working on, notes, examples, data sets, etc.
Warning: I will be cloning all of your repositories onto my own computer to keep track of your course work So don’t write hate mail about me in files in that directory.